package com.knowif.backend.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.knowif.backend.service.UserService;
import com.knowif.search.SearchCondition;
import com.knowif.system.model.RestBean;

@RestController
@RequestMapping("/tUser")
public class TUserController {
	
	@Autowired
	private UserService userService;

	@PostMapping("/query")
	public RestBean<?> selectTUser(@RequestBody SearchCondition searchCondition){
		return userService.selectTUser(searchCondition);
	}

	@PostMapping("/manager/query")
	public RestBean<?> selectManager(@RequestBody SearchCondition searchCondition){
		return userService.selectTUser(searchCondition);
	}

	/**
	 * @author: xingyao 
	 * @Description:  删除用户信息
	 * @param userId
	 * @return
	 */
	@PostMapping("/deleteTUser")
	public RestBean<?> deleteTUser(Integer userId){
		return userService.deleteTUser(userId);
	}
	
	/**
	 * @author: xingyao 
	 * @Description:  批量删除用户信息
	 * @param userIds
	 * @return
	 */
	@PostMapping("/deleteTUsers")
	public RestBean<?> deleteTUsers(List<Integer> userIds){
		return userService.deleteTUsers(userIds);
	}

}
